<template>
	<div>
		<ul class="mui-table-view">
			<router-link tag='li' class="mui-table-view-cell" :to="{path:'/setting'}">
				<a class="mui-navigate-right">换肤</a>
			</router-link>
			<li class="mui-table-view-cell">版本号
				<span class="mui-pull-right">1.0</span></li>
			<li class="mui-table-view-cell">作者
				<span class="mui-pull-right">李文杰</span></li>
				<li class="mui-table-view-cell" @click="$router.push('searchcook')">
					幸福餐厅
					<span class="mui-pull-right">学做菜</span></li>
			<li class="mui-table-view-cell">欢迎您
				<span class="mui-pull-right" v-if="logined">admin</span>
				<span class="mui-pull-right" v-else>游客</span>
			</li>
			<router-link tag='li' class="mui-table-view-cell" :to="{path:'/login'}" v-if="!logined">
				<a class="mui-navigate-right">去登陆</a>
			</router-link>
		</ul>
		<div class="mui-button-row" v-if="logined">
			<button type="button" class="mui-btn mui-btn-danger" @click="quite">退出登录</button>
		</div>
	</div>

</template>

<script>
	import store from '@/store/index.js';
	export default {
		data() {
			return {
			}
		},
		computed:{
			logined(){
				return store.getters.logined;
			}
		},
		methods: {
			quite() {
				localStorage.setItem('admin', '');
				localStorage.setItem('logined', false);
				store.dispatch('updateLogined',false);
			},
			checkLogin() {
				var logined = false;
				if (localStorage.getItem('admin') !== 'admin') {
					logined = false;
				} else if (localStorage.getItem('admin') === 'admin') {
					logined = true;
				};
				return logined;
			},
		}
	}
</script>

<style>
</style>
